﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.MultiUserAdminPageBase" %>
<ali:Get ID="Config" Object="InstanceConfig" Operation="GetBasicSettings()" />
<ali:Get ID="SubInstance" Object="SubInstance" Guid="Request.QueryString['SubInstanceID']" />
<ali:List ID="Site" Object="Site" Condition="SubInstanceID=SubInstance[ID]" Validate="True" />
<%If Site.Rows.Count > 0%>
	<section data-page="site_edit" data-title="编辑网站" data-id="<%=Site[InnerID]%>" data-sub-instance-id="<%=SubInstance[InnerID]%>" data-sub-instance-guid="<%=SubInstance[ID]%>">
		<div class="path1"><span>您的位置：</span><b class="<%=ContentLang%>Font"><%=Site[Name]%></b></div>
		<form action="" class="post">
			<div class="post-body">
				<table class="post-table">
					<tr>
						<th width="140">操作：</th>
						<td>
							<a href="<%=Config[PreviewUrl].Replace("{#PageID#}", Convert.ToString(Site[PageID]))%>" target="_blank" class="ali-button" data-preview-url="<%=Config[PreviewUrl]%>">预览网站</a>
							<a href="<%=Config[ActualUrl].Replace("{#PageID#}", Convert.ToString(Site[PageID]))%>" target="_blank" class="ali-button" data-actual-url="<%=Config[ActualUrl]%>">访问网站</a>
						</td>
					</tr>
					<tr>
						<th>名称：</th>
						<td><input type="text" name="Name" value="<%=Site[Name]%>" size="50" maxlength="150" class="ali-input ali-input-required <%=ContentLang%>Font" data-old="<%=Site[Name]%>"></td>
					</tr>
					<tr>
						<th>子域名：</th>
						<td><input type="text" name="PageID" value="<%=Site[PageID]%>" size="50" class="ali-input ali-input-required" data-old="<%=Site[PageID]%>"> 只由数字和字母组成，大于5位。</td>
					</tr>
					<tr>
						<th>招牌图片：</th>
						<td>
							<input type="text" name="Banner" value="<%=Site[Banner]%>" size="55" class="ali-input">
							<a class="ali-button ali-uploader">浏览...</a>
							<input type="hidden" name="BannerAllowedType" value="gif|jpg|jpeg|png|bmp">
						</td>
					</tr>
					<tr>
						<th>简介：</th>
						<td><textarea name="Description" data-lang="<%=ContentLang%>" data-instance-id="<%=InstanceID%>" class="editor-basic"><%=HttpUtility.HtmlEncode(Site[Description].ToString())%></textarea></td>
					</tr>
					<tr>
						<th>脚注：</th>
						<td><textarea name="Footer" data-lang="<%=ContentLang%>" data-instance-id="<%=InstanceID%>" class="editor-basic"><%=HttpUtility.HtmlEncode(Site[Footer].ToString())%></textarea></td>
					</tr>
					<tr>
						<th>统计代码：</th>
						<td><textarea type="text" name="StatCode" value="<%=Site[StatCode]%>" cols="60" rows="3" wrap="off" class="ali-inpu"></textarea></td>
					</tr>
					<tr>
						<th>网站标志：</th>
						<td>
							<input type="text" name="Logo" value="<%=Site[Logo]%>" size="55" class="ali-input">
							<a class="ali-button ali-uploader">浏览...</a>
							<input type="hidden" name="LogoAllowedType" value="gif|jpg|jpeg|png|bmp">
						</td>
					</tr>
					<tr>
						<th>链接标志：</th>
						<td>
							<input type="text" name="Link" value="<%=Site[Link]%>" size="55" class="ali-input">
							<a class="ali-button ali-uploader">浏览...</a>
							<input type="hidden" name="LinkAllowedType" value="gif|jpg|jpeg|png|bmp">
						</td>
					</tr>
					<tr>
						<th>广告模块：</th>
						<td>
							<select name="Ad" data-ali-widget="combo">
								<option value="" data-sub-instance-id="">未指定</option>
								<ali:List Source="AllSubInstances">
									<ali:Record>
										<%If Convert.ToString([2]) == "AliCMS.AdModule"%>
											<%If Convert.ToString([0]) == Convert.ToString(Site[AdInstanceID]) && Convert.ToString([3]) == Convert.ToString(Site[AdSubInstanceID])%>
												<option value="<%=[0]%>" data-sub-instance-id="<%=[3]%>" selected><%=[1]%> - <%=[4]%></option>
											<%Else%>
												<option value="<%=[0]%>" data-sub-instance-id="<%=[3]%>"><%=[1]%> - <%=[4]%></option>
											<%EndIf%>
										<%EndIf%>
									</ali:Record>
								</ali:List>
							</select>
						</td>
					</tr>
					<tr>
						<th>绑定企业：</th>
						<td>
							<select name="Company" data-ali-widget="combo" data-c="<%=Site[CompanyInstanceID]%>">
								<option value="" data-sub-instance-id="">未指定</option>
								<ali:List Source="AllSubInstances">
									<ali:Record>
										<%If Convert.ToString([2]) == "AliCMS.CompanyModule"%>
											<%If Convert.ToString([0]) == Convert.ToString(Site[CompanyInstanceID]) && Convert.ToString([3]) == Convert.ToString(Site[CompanySubInstanceID])%>
												<option value="<%=[0]%>" data-sub-instance-id="<%=[3]%>" selected><%=[1]%> - <%=[4]%></option>
											<%Else%>
												<option value="<%=[0]%>" data-sub-instance-id="<%=[3]%>"><%=[1]%> - <%=[4]%></option>
											<%EndIf%>
										<%EndIf%>
									</ali:Record>
								</ali:List>
							</select>
						</td>
					</tr>
					<tr>
						<th>搜索引擎优化：</th>
						<td>
							页面关键字：<input type="text" name="MetaKeywords" value="<%=Site[MetaKeywords]%>" size="40" maxlength="255" class="ali-input <%=ContentLang%>Font">
							页面描述：<input type="text" name="MetaDescription" value="<%=Site[MetaDescription]%>" size="40" maxlength="255" class="ali-input <%=ContentLang%>Font">
						</td>
					</tr>
				</table>
			</div>
			<div class="post-footer"><button type="submit" class="ali-button">保 存</button></div>
		</form>
	</section>
<%Else%>
	<section data-page="site_edit" data-title="编辑网站" data-id="0" data-sub-instance-id="<%=SubInstance[InnerID]%>" data-sub-instance-guid="<%=SubInstance[ID]%>">
		<div class="path1"><span>您的位置：</span><b class="<%=ContentLang%>Font"><%=SubInstance[Name]%></b></div>
		<form action="" class="post">
			<div class="post-body">
				<table class="post-table">
					<tr>
						<th>名称：</th>
						<td><input type="text" name="Name" value="<%=SubInstance[Name]%>" size="50" maxlength="150" class="ali-input ali-input-required <%=ContentLang%>Font" data-old="<%=SubInstance[Name]%>"></td>
					</tr>
					<tr>
						<th>子域名：</th>
						<td><input type="text" name="PageID" size="50" class="ali-input ali-input-required"> 只由数字和字母组成，大于5位。</td>
					</tr>
					<tr>
						<th>招牌图片：</th>
						<td>
							<input type="text" name="Banner" size="55" class="ali-input">
							<a class="ali-button ali-uploader">浏览...</a>
							<input type="hidden" name="BannerAllowedType" value="gif|jpg|jpeg|png|bmp">
						</td>
					</tr>
					<tr>
						<th>简介：</th>
						<td><textarea name="Description" data-lang="<%=ContentLang%>" data-instance-id="<%=InstanceID%>" class="editor-basic"></textarea></td>
					</tr>
					<tr>
						<th>脚注：</th>
						<td><textarea name="Footer" data-lang="<%=ContentLang%>" data-instance-id="<%=InstanceID%>" class="editor-basic"></textarea></td>
					</tr>
					<tr>
						<th>统计代码：</th>
						<td><textarea type="text" name="StatCode" cols="60" rows="3" wrap="off" class="ali-inpu"></textarea></td>
					</tr>
					<tr>
						<th>网站标志：</th>
						<td>
							<input type="text" name="Logo" size="55" class="ali-input">
							<a class="ali-button ali-uploader">浏览...</a>
							<input type="hidden" name="LogoAllowedType" value="gif|jpg|jpeg|png|bmp">
						</td>
					</tr>
					<tr>
						<th>链接标志：</th>
						<td>
							<input type="text" name="Link" size="55" class="ali-input">
							<a class="ali-button ali-uploader">浏览...</a>
							<input type="hidden" name="LinkAllowedType" value="gif|jpg|jpeg|png|bmp">
						</td>
					</tr>
					<tr>
						<th>广告模块：</th>
						<td>
							<select name="Ad" data-ali-widget="combo">
								<option value="" data-sub-instance-id="">未指定</option>
								<ali:List Source="AllSubInstances">
									<ali:Record>
										<%If Convert.ToString([2]) == "AliCMS.AdModule"%>
											<%If Convert.ToString([0]) == Convert.ToString(Site[AdInstanceID]) && Convert.ToString([3]) == Convert.ToString(Site[AdSubInstanceID])%>
												<option value="<%=[0]%>" data-sub-instance-id="<%=[3]%>" selected><%=[1]%> - <%=[4]%></option>
											<%Else%>
												<option value="<%=[0]%>" data-sub-instance-id="<%=[3]%>"><%=[1]%> - <%=[4]%></option>
											<%EndIf%>
										<%EndIf%>
									</ali:Record>
								</ali:List>
							</select>
						</td>
					</tr>
					<tr>
						<th>搜索引擎优化：</th>
						<td>
							页面关键字：<input type="text" name="MetaKeywords" size="40" maxlength="255" class="ali-input <%=ContentLang%>Font">
							页面描述：<input type="text" name="MetaDescription" size="40" maxlength="255" class="ali-input <%=ContentLang%>Font">
						</td>
					</tr>
				</table>
			</div>
			<div class="post-footer"><button type="submit" class="ali-button">保 存</button></div>
		</form>
	</section>
<%EndIf%>
